package com.entity;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the USER_ database table.
 * 
 */
@Entity
@Table(name="USER_")
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="USER__USERID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="USER__USERID_GENERATOR")
	@Column(name="USER_ID")
	private long userId;

	@Column(name="USER_IFDELETE")
	private BigDecimal userIfdelete;

	@Column(name="USER_INTODATE")
	private Date userIntodate;

	@Column(name="USER_NAME")
	private String userName;

	@Column(name="USER_PEN")
	private String userPen;

	@Column(name="USER_PHONE")
	private String userPhone;

	@Column(name="USER_PWD")
	private String userPwd;

	@Column(name="USER_UID")
	private String userUid;

	//bi-directional many-to-one association to Chanceinfo
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Chanceinfo> chanceinfos;

	//bi-directional many-to-one association to Complain
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Complain> complains;

	//bi-directional many-to-one association to Confirm
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Confirm> confirms;

	//bi-directional many-to-one association to Customer
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Customer> customers;

	//bi-directional many-to-one association to Detection
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Detection> detections;

	//bi-directional many-to-one association to Diystatus
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Diystatus> diystatuses;

	//bi-directional many-to-one association to Notelist
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Notelist> notelists;

	//bi-directional many-to-one association to Offerinfo
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Offerinfo> offerinfos;

	//bi-directional many-to-one association to Process
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Process> processes;

	//bi-directional many-to-one association to Purchase
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Purchase> purchases;

	//bi-directional many-to-one association to Qa
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Qa> qas;

	//bi-directional many-to-one association to Serve
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Serve> serves;

	//bi-directional many-to-one association to Solicitude
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Solicitude> solicitudes;

	//bi-directional many-to-one association to Systemlog
	@OneToMany(mappedBy="user")
	@JSONField(serialize=false)
	private List<Systemlog> systemlogs;

	//bi-directional many-to-one association to Dept
	@ManyToOne
	@JoinColumn(name="DEPT_ID")
	private Dept dept;

	//bi-directional many-to-many association to Role
	@ManyToMany
	@JSONField(serialize=false)
	@JoinTable(
		name="RELATIONSHIP_28"
		, joinColumns={
			@JoinColumn(name="USER_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="ROLE_ID")
			}
		)
	private List<Role> roles;

	//部门id
	@Transient
	private Long deptId;
	
	public Long getDeptId() {
		return deptId;
	}

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

	public User() {
	}

	public long getUserId() {
		return this.userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public BigDecimal getUserIfdelete() {
		return this.userIfdelete;
	}

	public void setUserIfdelete(BigDecimal userIfdelete) {
		this.userIfdelete = userIfdelete;
	}

	public Date getUserIntodate() {
		return this.userIntodate;
	}

	public void setUserIntodate(Date userIntodate) {
		this.userIntodate = userIntodate;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPen() {
		return this.userPen;
	}

	public void setUserPen(String userPen) {
		this.userPen = userPen;
	}

	public String getUserPhone() {
		return this.userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	public String getUserPwd() {
		return this.userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	public String getUserUid() {
		return this.userUid;
	}

	public void setUserUid(String userUid) {
		this.userUid = userUid;
	}

	public List<Chanceinfo> getChanceinfos() {
		return this.chanceinfos;
	}

	public void setChanceinfos(List<Chanceinfo> chanceinfos) {
		this.chanceinfos = chanceinfos;
	}

	public Chanceinfo addChanceinfo(Chanceinfo chanceinfo) {
		getChanceinfos().add(chanceinfo);
		chanceinfo.setUser(this);

		return chanceinfo;
	}

	public Chanceinfo removeChanceinfo(Chanceinfo chanceinfo) {
		getChanceinfos().remove(chanceinfo);
		chanceinfo.setUser(null);

		return chanceinfo;
	}

	public List<Complain> getComplains() {
		return this.complains;
	}

	public void setComplains(List<Complain> complains) {
		this.complains = complains;
	}

	public Complain addComplain(Complain complain) {
		getComplains().add(complain);
		complain.setUser(this);

		return complain;
	}

	public Complain removeComplain(Complain complain) {
		getComplains().remove(complain);
		complain.setUser(null);

		return complain;
	}

	public List<Confirm> getConfirms() {
		return this.confirms;
	}

	public void setConfirms(List<Confirm> confirms) {
		this.confirms = confirms;
	}

	public Confirm addConfirm(Confirm confirm) {
		getConfirms().add(confirm);
		confirm.setUser(this);

		return confirm;
	}

	public Confirm removeConfirm(Confirm confirm) {
		getConfirms().remove(confirm);
		confirm.setUser(null);

		return confirm;
	}

	public List<Customer> getCustomers() {
		return this.customers;
	}

	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}

	public Customer addCustomer(Customer customer) {
		getCustomers().add(customer);
		customer.setUser(this);

		return customer;
	}

	public Customer removeCustomer(Customer customer) {
		getCustomers().remove(customer);
		customer.setUser(null);

		return customer;
	}

	public List<Detection> getDetections() {
		return this.detections;
	}

	public void setDetections(List<Detection> detections) {
		this.detections = detections;
	}

	public Detection addDetection(Detection detection) {
		getDetections().add(detection);
		detection.setUser(this);

		return detection;
	}

	public Detection removeDetection(Detection detection) {
		getDetections().remove(detection);
		detection.setUser(null);

		return detection;
	}

	public List<Diystatus> getDiystatuses() {
		return this.diystatuses;
	}

	public void setDiystatuses(List<Diystatus> diystatuses) {
		this.diystatuses = diystatuses;
	}

	public Diystatus addDiystatus(Diystatus diystatus) {
		getDiystatuses().add(diystatus);
		diystatus.setUser(this);

		return diystatus;
	}

	public Diystatus removeDiystatus(Diystatus diystatus) {
		getDiystatuses().remove(diystatus);
		diystatus.setUser(null);

		return diystatus;
	}

	public List<Notelist> getNotelists() {
		return this.notelists;
	}

	public void setNotelists(List<Notelist> notelists) {
		this.notelists = notelists;
	}

	public Notelist addNotelist(Notelist notelist) {
		getNotelists().add(notelist);
		notelist.setUser(this);

		return notelist;
	}

	public Notelist removeNotelist(Notelist notelist) {
		getNotelists().remove(notelist);
		notelist.setUser(null);

		return notelist;
	}

	public List<Offerinfo> getOfferinfos() {
		return this.offerinfos;
	}

	public void setOfferinfos(List<Offerinfo> offerinfos) {
		this.offerinfos = offerinfos;
	}

	public Offerinfo addOfferinfo(Offerinfo offerinfo) {
		getOfferinfos().add(offerinfo);
		offerinfo.setUser(this);

		return offerinfo;
	}

	public Offerinfo removeOfferinfo(Offerinfo offerinfo) {
		getOfferinfos().remove(offerinfo);
		offerinfo.setUser(null);

		return offerinfo;
	}

	public List<Process> getProcesses() {
		return this.processes;
	}

	public void setProcesses(List<Process> processes) {
		this.processes = processes;
	}

	public Process addProcess(Process process) {
		getProcesses().add(process);
		process.setUser(this);

		return process;
	}

	public Process removeProcess(Process process) {
		getProcesses().remove(process);
		process.setUser(null);

		return process;
	}

	public List<Purchase> getPurchases() {
		return this.purchases;
	}

	public void setPurchases(List<Purchase> purchases) {
		this.purchases = purchases;
	}

	public Purchase addPurchas(Purchase purchas) {
		getPurchases().add(purchas);
		purchas.setUser(this);

		return purchas;
	}

	public Purchase removePurchas(Purchase purchas) {
		getPurchases().remove(purchas);
		purchas.setUser(null);

		return purchas;
	}

	public List<Qa> getQas() {
		return this.qas;
	}

	public void setQas(List<Qa> qas) {
		this.qas = qas;
	}

	public Qa addQa(Qa qa) {
		getQas().add(qa);
		qa.setUser(this);

		return qa;
	}

	public Qa removeQa(Qa qa) {
		getQas().remove(qa);
		qa.setUser(null);

		return qa;
	}

	public List<Serve> getServes() {
		return this.serves;
	}

	public void setServes(List<Serve> serves) {
		this.serves = serves;
	}

	public Serve addServe(Serve serve) {
		getServes().add(serve);
		serve.setUser(this);

		return serve;
	}

	public Serve removeServe(Serve serve) {
		getServes().remove(serve);
		serve.setUser(null);

		return serve;
	}

	public List<Solicitude> getSolicitudes() {
		return this.solicitudes;
	}

	public void setSolicitudes(List<Solicitude> solicitudes) {
		this.solicitudes = solicitudes;
	}

	public Solicitude addSolicitude(Solicitude solicitude) {
		getSolicitudes().add(solicitude);
		solicitude.setUser(this);

		return solicitude;
	}

	public Solicitude removeSolicitude(Solicitude solicitude) {
		getSolicitudes().remove(solicitude);
		solicitude.setUser(null);

		return solicitude;
	}

	public List<Systemlog> getSystemlogs() {
		return this.systemlogs;
	}

	public void setSystemlogs(List<Systemlog> systemlogs) {
		this.systemlogs = systemlogs;
	}

	public Systemlog addSystemlog(Systemlog systemlog) {
		getSystemlogs().add(systemlog);
		systemlog.setUser(this);

		return systemlog;
	}

	public Systemlog removeSystemlog(Systemlog systemlog) {
		getSystemlogs().remove(systemlog);
		systemlog.setUser(null);

		return systemlog;
	}

	public Dept getDept() {
		return this.dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}